package org.tp.web.controller;

import java.util.HashMap;
import java.util.Map;

import org.tp.framework.annotation.Autowired;
import org.tp.framework.annotation.MvcMapping;
import org.tp.framework.annotation.ResponseBody;
import org.tp.web.service.TestService;

@MvcMapping(url = "/test")
public class TestController {

    @Autowired
    private TestService testService;

    @MvcMapping(url = "/say.do", method = "GET")
    public void test() {
        System.out.println("服务调用之前");
        testService.test();
    }

    @MvcMapping(url = "/out.do", method = "GET")
    @ResponseBody
    public String out() {

        return "测试";
    }

    @MvcMapping(url = "/out1.do", method = "GET")
    @ResponseBody
    public Map<String, String> out1(String name, String age) {

        System.out.println(name + "\t" + age);
        Map<String, String> map = new HashMap<>();

        map.put("name", name);
        map.put("age", age);

        return map;
    }

}
